package org.springblade.modules.admin.vo;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springblade.modules.admin.enums.MaintainPlanContentEnum;
import org.springblade.modules.admin.enums.MaintainPlanContentStatusEnum;
import org.springblade.modules.admin.enums.PlanContentFormTypeEnum;

/**
 * @author zcc
 * @version 1.0
 * @date 2021/6/24 14:40
 */
@ApiModel("大屏数据返回model")
@Data
public class SugarDataVo {

	@ApiModelProperty("时间")
	private String date;

	@ApiModelProperty("任务类型")
	private String typeStatusName;

	private Integer typeStatus;

	@ApiModelProperty("电梯位置")
	private String elevatorAddress;

	@ApiModelProperty("渠道来源")
	private String planFromName;

	private Integer planFrom;

	@ApiModelProperty("任务当前状态")
	private String statusName;

	private Integer status;

	public void setStatus(Integer status) {
		this.status = status;
		if (status == MaintainPlanContentEnum.MAINTAIN_WX.getId()) {
			this.typeStatusName = MaintainPlanContentEnum.MAINTAIN_WX.getName();
		} else if (status == MaintainPlanContentEnum.MAINTAIN_KR.getId()) {
			this.typeStatusName = MaintainPlanContentEnum.MAINTAIN_KR.getName();
		}
	}

	public void setPlanFrom(Integer planFrom) {
		this.planFrom = planFrom;
		if (planFrom.equals(PlanContentFormTypeEnum.PEOPLE.getId())) {
			planFromName = PlanContentFormTypeEnum.PEOPLE.getName();
		} else if (planFrom.equals(PlanContentFormTypeEnum.BUILDING.getId())) {
			planFromName = PlanContentFormTypeEnum.BUILDING.getName();
		} else if (planFrom.equals(PlanContentFormTypeEnum.WEIXIN.getId())) {
			planFromName = PlanContentFormTypeEnum.WEIXIN.getName();
		} else if (planFrom.equals(PlanContentFormTypeEnum.PHONE.getId())) {
			planFromName = PlanContentFormTypeEnum.PHONE.getName();
		} else if (planFrom.equals(PlanContentFormTypeEnum.SYSTEM.getId())) {
			planFromName = PlanContentFormTypeEnum.SYSTEM.getName();
		}
	}

	public void setTypeStatus(Integer typeStatus) {
		this.typeStatus = typeStatus;
		if (typeStatus == MaintainPlanContentStatusEnum.DISABLE.getId()) {
			this.statusName = MaintainPlanContentStatusEnum.DISABLE.getName();
		} else if (typeStatus == MaintainPlanContentStatusEnum.BEGIN_PROCESSED.getId()) {
			this.statusName = MaintainPlanContentStatusEnum.BEGIN_PROCESSED.getName();
		} else if (typeStatus == MaintainPlanContentStatusEnum.FINISH.getId()) {
			this.statusName = MaintainPlanContentStatusEnum.FINISH.getName();
		}
	}
}
